#include "CSetColorCommand.h"
#include "CUserInterface.h"
#include "CLevelEditor.h"
#include "ISceneManager.h"
#include "ISceneNode.h"

extern CGlobals* g;
extern CUserInterface* ui;
extern CLevelEditor* editor;

CSetColorCommand::CSetColorCommand (int id, SColor oldCol, SColor newCol)
{
	m_id = id;
	m_oldColor = oldCol;
	m_newColor = newCol;
	setDescription(L"change color");
}

void CSetColorCommand::redo ()
{
	g->sceneManager->getSceneNodeFromId(m_id)->getMaterial(0).EmissiveColor = m_newColor;
}

void CSetColorCommand::undo ()
{
	g->sceneManager->getSceneNodeFromId(m_id)->getMaterial(0).EmissiveColor = m_oldColor;
}
